package com.graduation.vaccine.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.graduation.vaccine.pojo.DepartmentProduction;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ZhaoJunYao
 * @since 2022-04-23
 */
@Mapper
public interface DepartmentProductionMapper extends BaseMapper<DepartmentProduction> {

    DepartmentProduction getTotalByDepartmentCodeAndProductionId(String departmentCode, Integer productionId);

    Integer reduceTotal(String departmentCode, Integer productionId, Integer version);

    Integer addTotal(String departmentCode, Integer productionId, Integer version);

    //组织管理员入库
    Integer addStock(@Param("productionId") Integer productionId, @Param("number") Integer number, @Param("departmentCode") String departmentCode, @Param("version") Integer version);

    int addOne(@Param("departmentCode") String departmentCode, @Param("productionId") Integer productionId, @Param("number") Integer number);
}
